﻿using System;
using System.Collections.Generic;
using System.Windows.Controls;
using MVVM_CAD.Common;
using MVVM_CAD.Model;

namespace MVVM_CAD.Strategy
{
    public class PointToolStrategy : StrategyBase
    {
        public PointToolStrategy(IFigure figure) : base(figure)
        {
        }

        public override IFigure PerformMouseLeftClicDownEvent(Canvas canvas, IPoint point, IEnumerable<IFigure> figures)
        {
            ValidateFigureIsNew<Point>();
            Figure.PointsCollection.Add(point);
            Figure.PointsCollection.Add(new CustomPoint(point.X + 1, point.Y));
            Figure.PointsCollection.Add(new CustomPoint(point.X - 1, point.Y));
            Figure.PointsCollection.Add(new CustomPoint(point.X, point.Y + 1));
            Figure.PointsCollection.Add(new CustomPoint(point.X, point.Y - 1));

            FigureDrawer.DrawFigure(canvas, Figure);
            return CloseFigureDrawing();
        }

        public override IFigure PerformMouseLeftClicUpEvent(Canvas canvas, IPoint point, IEnumerable<IFigure> figures)
        {
            throw new NotImplementedException();
        }

        public override IFigure PerformMouseRightClicDownEvent(Canvas canvas, IPoint point, IEnumerable<IFigure> figures)
        {
            ValidateFigureIsNew<Point>();
            return Figure;
        }

        public override IFigure PerformMouseMoveEvent(IPoint point, IEnumerable<IFigure> figures)
        {
            throw new NotImplementedException();
        }

        public override IFigure PerformMouseMoveEvent(DrawingCanvas Canvas, CustomPoint point)
        {
            throw new NotImplementedException();
        }
    }
}
